Skip to content

Conversation

@jasonk000
Copy link
Contributor

Introduce a ConcurrentBitField backed by an AtomicLongArray, and use it to do proper CAS-based state tracking in the concurrent ObjectMarker.

This is a potential fix to issue #57.

Introduce a ConcurrentBitField backed by an AtomicLongArray, and use it
to do proper CAS-based state tracking in the concurrent ObjectMarker.

This is a potential fix to issue #57.
import org.junit.Test;
import org.junit.rules.ExpectedException;

public class ConcurrentBitFieldTest
Copy link
Contributor Author

@jasonk000 jasonk000 Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please suggest any additional / fixes to tests.

Bundle-SymbolicName: org.eclipse.mat.report;singleton:=true
Bundle-Version: 1.17.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-RequiredExecutionEnvironment: JavaSE-17
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was required to support compareAndExchange. If we cannot do xchg, it can be done with compareAndSet, but involves additional CAS operations.

// Therefore, we need to use full compare and exchange rather than
// compare and set.

while (true)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Appreciate any extra eyes on this!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A colleague suggested adding a jcstress, did so in 9499a38.

Using a standalone project and readme since the jcstress modules are not
made available for use with tycho or packaged in orbit. Added a README
to explain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants